package com.baidu.sggc.mapper;

import com.baidu.sggc.entity.AuditLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 审计日志Mapper
 */
@Mapper
public interface AuditLogMapper extends BaseMapper<AuditLog> {

    /**
     * 查询 audit_log 中 pk 大于 lastOffset 的新数据，限制批量大小
     */
    List<AuditLog> selectNewLogs(@Param("lastOffset") long lastOffset, @Param("limit") int limit);

    AuditLog findByPk(@Param("pk") Long pk);
}